//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    background: [{ "id": 165, "name": "", "orders": 5, "picurl": "http://image.huanqiuxiaozhen.com/%E7%84%A6%E7%82%B9%E5%9B%BE/2017_11_2_1509610582651", "targeturl": "http://wx.huanqiuxiaozhen.com/type-list.html?goodstype=101", "distributorid": "all" }, { "id": 162, "name": "童年时光", "orders": 3, "picurl": "http://image.huanqiuxiaozhen.com/%E7%84%A6%E7%82%B9%E5%9B%BE/2017_10_7_1507368199357", "targeturl": "http://wx.huanqiuxiaozhen.com/brand-list.html?brand=34&typeid=3", "distributorid": "all" }],
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    frnameArray: [{ url: 'https://img.alicdn.com/imgextra/i1/2431751765/TB2017BmFXXXXXNXpXXXXXXXXXX_!!2431751765.jpg' }, { url: 'https://img.alicdn.com/imgextra/i1/2431751765/TB2017BmFXXXXXNXpXXXXXXXXXX_!!2431751765.jpg' }],
    // text:"这是一个页面"
    actionSheetHidden: true,
    actionSheetItems: ['item1']
  },

  onLoad() {
    this.getSystemInfos();
  },
  onLaunch(options) {
    console.log('// Do something initial when 2.');
  },
  onShow(options) {
    console.log('// Do something initial whed3.');
  },
  onHide() {
    console.log('// Do something initial4.');
  },
  onError(msg) {
    console.log(msg)
  },

  getSystemInfos() {
    wx.getSystemInfo({
      success: (res) => {
        console.log(res)
        this.setData({
          deviceWidth: res.windowWidth,
          deviceHeight: res.windowHeight,
        })
      }
    })
  },
  listenerButton: function () {
    this.setData({
      //取反
      actionSheetHidden: !this.data.actionSheetHidden
    });
  },

  listenerActionSheet: function () {
    this.setData({
      actionSheetHidden: !this.data.actionSheetHidden
    })
  },
})
